package com.evil.kingdom.pojo.entity.captcha;

import com.evil.common.mongo.entity.SingleName;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 验证码
 *
 * @author liyang
 * @date 2024-06-06 18:01
 */
@Getter
@Setter
@Document
@NoArgsConstructor
public class Captcha implements SingleName {

    /**
     * 名称
     * 手机号/时间戳
     */
    @Id
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 验证码
     */
    @NotBlank(message = "验证码不能为空")
    private String code;

    @Override
    public String getEntityName() {
        return "验证码";
    }
}
